package cn.wolfcode.wolf2w.util;

import cn.wolfcode.wolf2w.exception.LogicException;
import org.springframework.util.StringUtils;

public class AssertUtil {

    public static void hasLength(String value,String msg){
        if (!StringUtils.hasLength(value)){
            throw new LogicException(msg);
        }
    }
    public static void isEqueal(String password,String rpassword,String msg){
        if (password==null || rpassword ==null){
            throw new LogicException("密码不能为空");
        }
        if (!password.equals(rpassword)){
            throw new LogicException(msg);
        }
    }
}
